
public class NOD {
	public static int del(int n,int m){
		int count;
		int exit;
		if(n < m){
			count = m % n;
			if(count != 0)
				return del(n,m % n);
			else 
				exit = n;
		}
		else{
			count = n % m;
			if(count != 0)
				return del(n % m,m);
			else
				exit = m;
		}
	return exit;	
		
		
	}
	
	public static int Evc(int a, int b){
		while(a != 0 && b != 0){
			if(a > b)
				a = a % b;
			else b = b % a;
		}
		return(a + b);
	}

	public static int all(int x,int y){
		if(x > y && x % y == 0)
			return y;
		if(y <= x && y % x == 0)
			return x;
		int count;
		if(x < y){
			count = x - 1;
			while((y % count != 0 || x % count != 0) && count > 0)
				count--;
		}
		else {
			count = y - 1;
			while((x % count != 0 || y % count != 0) && count > 0)
				count--;
		}
		return count;
		
	}
		
	
	public static void main(String[] args) {
		int a = 170; 
		int b = 230;
		long start = System.nanoTime();
		all(a,b);
		long estTime = System.nanoTime() - start;
		System.out.println(estTime);
		System.out.println(all(a,b));
		
		
	}

}
